package cn.edu.xaut.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.xaut.bean.UserProject;
import cn.edu.xaut.dao.ManageDaoImpl;

@WebServlet("/ManageSearchInfo")
public class ManageSearchInfo extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String searchInfo = request.getParameter("searchInfo");
		String searchCategory = request.getParameter("searchCategory");
		
		ManageDaoImpl mdi = new ManageDaoImpl();
		List<UserProject> list = mdi.showSearchs(searchInfo,searchCategory);
		request.setAttribute("projectsList",list);
		
		request.getRequestDispatcher("/static/manage_search_info.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		doGet(request, response);
	}

}
